<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {
            width: 500px;
            height: 500px;
            border: 5px red solid;
            background-image: url("../images/img.jpg");
        }
    </style>
</head>
<body>
    <!--背景图默认充满整个容器-->
    <div>hello</div>
</body>
</html>